package main

import (
	"fmt"
	v1job "gitee.com/scottq/go-framework/src/v1/jobserver"
	v1log "gitee.com/scottq/go-framework/src/v1/log"
	"os"
	"path/filepath"
)

func main() {
	name := "example"
	logPath := fmt.Sprintf("./runtime/logs/%s.log", filepath.Base(os.Args[0]))
	logger := v1log.NewZapLog(name, logPath, nil)

	job := v1job.NewJob("printX", func() {
		for i := 0; i <= 10; i++ {
			logger.Info(fmt.Sprintf("No.%d",i))
		}
	})
	job.SetCoNum(2)
	job.AddLogger(logger)
	job.Run()
}
